package com.fubt.repeat.config;

import java.util.ArrayList;
import java.util.List;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.fubt.repeat.web.WebContextFilter;

@Configuration
public class WebConfig {

    @Bean
    public FilterRegistrationBean<WebContextFilter> webContextFilter() {
        FilterRegistrationBean<WebContextFilter> registration = new FilterRegistrationBean<WebContextFilter>();

        registration.setName("WebContextFilter");
        registration.setFilter(new WebContextFilter());
        List<String> urls = new ArrayList<String>();
        urls.add("/*");

        registration.setUrlPatterns(urls);
        return registration;
    }

}
